<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>选择喜欢的</title>
    <style>
        .list {
            display: inline-block;
        }
    </style>
</head>

<body>
    <div id="app">
        <h1>请选择你喜欢的专栏</h1>
        <div class="list" v-for="(item, index) in list" :key="index">
            <input type="checkbox" :value="item" :id="item" @change="changCheckbox" />
            <label :for="item">{{item}}</label>
        </div>
        <ul>
            <li v-for="(item, index) in newList" :key="index">{{item}}</li>
        </ul>
    </div>

    <script src="../vue.js"></script>
    <script>
        let app = new Vue({
            el: '#app',
            data: {
                list: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
                newList: []
            },
            methods: {
                changCheckbox(e) {
                    if (true) {
                        console.log(e);
                    }
                    this.newList.push(e.target.value);
                }
            },
            computed: {
            }
        })
    </script>
</body>

</html>